package org.ruanjj.designmodel.observemodel;

import java.util.ArrayList;
import java.util.List;

public class weatherSubject implements IWeatherSubject{
    List<Observer> observersList = new ArrayList<>();

    @Override
    public void registerObserver(Observer observer) {
        observersList.add(observer);
    }

    @Override
    public void removeObserver(Observer observer) {
        observersList.remove(observer);
    }

    @Override
    public void notifyObservers() {
        for(Observer o:observersList){
            o.update();
        }
    }
}
